import request from "@/utils/request";
import axios from 'axios';

// 获取列表
export function getList(query) {
  return request({
    // url: "/fxfzaqbz/data/getAllImportantActivity",
    url: "/fxfzaqbz/data/getAllByRole",
    method: "get",
    params: query,
  });
}

// 获取等级评估列表
export function getAssessList(query) {
  return request({
    url: "/fxfzaqbz/data/getAllSeismicHazardAssess",
    method: "get",
    params: query,
  });
}

export function getDataQuantification(id) {
  return request({
    url: "/fxfzaqbz/data/getByActiveId/"+ id,
    method: "get",
  });
}

export function getDataExport(id) {
  return request({
    url: "/fxfzaqbz/data/getAllReportById/"+ id,
    method: "get",
  });
}

//删除
export function delList(ids) {
  return request({
    url: "/fxfzaqbz/data/delImportantActivity/" + ids,
    method: "post",
  });
}

//新增
export function saveList(data) {
  return request({
    url: "/fxfzaqbz/data/saveImportantActivity",
    method: "post",
    data: data,
  });
}

export function saveReport(data) {
  return request({
    url: "/fxfzaqbz/data/saveReport",
    method: "post",
    data: data,
  });
}

export function reUpload(data) {
  return request({
    url: "/fxfzaqbz/data/reUpload",
    method: "post",
    data: data,
  });
}

//删除
export function delReport(id) {
  return request({
    url: "/fxfzaqbz/data/delReports/" + id,
    method: "post",
  });
}

//修改
export function updateList(query) {
  return request({
    url: "/fxfzaqbz/data/updateImportantActivity",
    method: "post",
    data: query,
  });
}

//搜索
export function serchList(query) {
  return request({
    url: "/fxfzaqbz/data/searchList",
    method: "get",
    params: query,
  });
}

export function getImport(id) {
  return request({
    url: "/fxfzaqbz/data/getImportantActivity/" + id,
    method: "get",
  });
}

export function getActivityIdList() {
  return request({
    url: "/fxfzaqbz/data/getNewImportantActivityId",
    method: "get",
  });
}


//校验重点目标
export function getName(ssJzwmc) {
  return request({
    url: "/fxfzaqbz/data/getSiteByName",
    method: "get",
    params:ssJzwmc
  });
}

//获取单位
export function getDw() {
  return request({
    url: "/fxfz/sOrg/getOrgTree",
    method: "get",
  });
}

// 获取reportId
export function getIdReport(query) {
  return request({
    url: "/fxfzaqbz/data/getCode",
    method: "post",
    data: query,
  });
}

// 获取是否覆盖
export function getReportByFC(query) {
  return request({
    url: "/fxfzaqbz/data/getReportByFC",
    method: "post",
    data: query,
  });
}

// 查看历史版本
export function getVersion(query) {
  return request({
    url: "/fxfzaqbz/data/getHistory",
    method: "post",
    data: query,
  });
}

//提交评核
export function submitAudit(data) {
  return request({
    url: "/fxfzaqbz/data/saveExpert",
    method: "post",
    data:data,
  });
}

//提交审核
export function submitSh(id) {
  return request({
    url: "/fxfzaqbz/data/submitSh/"+id,
    method: "post",
  });
}

// 查看意见id
export function getAttachIds(id) {
  return request({
    url: "/fxfzaqbz/data/getAttachIds/"+id,
    method: "get",
  });
}

// 上传评审意见
export function uploadYiJian(data) {
  return request({
    url: "/fxfzaqbz/data/uploadYiJian",
    method: "post",
    data:data
  });
}

// 结束活动
export function endActive(id) {
  return request({
    url: "/fxfzaqbz/data/updateActivityEndStatus/"+id,
    method: "post",
  });
}

// 查询
export function getDisposeManager(id) {
  return request({
    url: '/fxfzaqbz/data/getDisposeManager/' + id,
    method: 'get'
  })
}

// 获取辅助分析对策
export function getCzByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getCzByIaId/"+id,
    method: "get",
  });
}

// 获取辅助分析对策
export function getFzByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getFzByIaId/"+id,
    method: "get",
  });
}

// 获取需紧急
export function getAzByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getAzByIaId/"+id,
    method: "get",
  });
}

// 获取重点
export function getZdByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getZdByIaId/"+id,
    method: "get",
  });
}

// 获取人口
export function getCasualtiesByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getCasualtiesByIaId/"+id,
    method: "get",
  });
}

// 获取房屋
export function getDisasterAssByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getDisasterAssByIaId/"+id,
    method: "get",
  });
}

// 获取地震趋势的
export function getRiskAssessmentByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getRiskAssessmentByIaId/"+id,
    method: "get",
  });
}

// 获取次生
export function getSecondDisastersByIaId(id) {
  return request({
    url: "/fxfzaqbz/domain/getSecondDisastersByIaId/"+id,
    method: "get",
  });
}

// 改变状态
export function updateBigStatus(data) {
  return request({
    url: "/fxfzaqbz/data/updateBigStatus",
    method: "post",
    data:data
  });
}

// 查看报告信息
export function getReportData(id) {
  return request({
    url: "/fxfzaqbz/data/getReportByIaId?id="+id,
    method: "get",
  });
}

// 退回报告
export function reportBack(id) {
  return request({
    url: "/fxfzaqbz/report/back/"+id,
    method: "get",
  });
}

// 查看报告提交信息
export function getLittleReport(id) {
  return request({
    url: "/fxfzaqbz/report/getLittleReport/"+id,
    method: "get",
  });
}

// 生成报告信息
export function reportCreat(data,cancel) {
  return request({
    url: '/fxfzaqbz/report/mergeReport',
    method: "post",
    data:data,
    cancelToken: new axios.CancelToken(function executor(c) {
      cancel.c = c;
    })
  });
}

// 获取重点目标数据
export function getZdmb(data) {
  return request({
    url: "/fxfzaqbz/data/getAllSiteName1",
    method: "get",
    params:data
  });
}

//获取活动行政区划范围extent
export function getExtentByIaId(id) {
  return request({
    url: "/fxfzaqbz/data/getCodeByIaId/" + id,
    method: "get",
  });
}

// 获取登陆人全县
export function getAdmin() {
  return request({
    url: '/fxfzaqbz/data/getRole',
    method: 'get'
  })
}

// 任务是否进入审核
export function isEnterReview(data) {
  return request({
    url: '/fxfzaqbz/data/getExamine',
    method: 'get',
    params:data
  })
}

// expertManagementDel,
// 获取评审专家
export function expertManagementList(data) {
  return request({
    url: '/data/expertManagement/getAll',
    method: 'get',
    params:data
  })
}

// 添加专家
export function expertManagementSave(id) {
  return request({
    url: `/data/expertManagement/save/${id}`,
    method: "post",
  });
}

// 删除专家
export function expertManagementDel(id) {
  return request({
    url: `/data/expertManagement/delete/${id}`,
    method: "post",
  });
}